package cn.itsource.ymcc.feign;

import cn.itsource.ymcc.domain.CourseDoc;
import cn.itsource.ymcc.feign.fallback.ESCourseFeignFallbackFactory;
import cn.itsource.ymcc.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "service-search",fallbackFactory = ESCourseFeignFallbackFactory.class)
public interface ESCourseFeign {
    @PostMapping("/es/save")
    public JsonResult save(@RequestBody List<CourseDoc> courseDoc);

    @GetMapping("/es/select/{courseId}")
    public JsonResult selectByCourseId(@PathVariable("courseId")Long courseId);

    @PostMapping("/es/selectByCourseIds")
    public JsonResult selectByCourseIds(@RequestBody List<Long> ids);
}
